/* Filename: myprintenv.c
 * Description: 打印所有环境变量
 * Last modified: humble 20200319 19:27
 */
#include <stdio.h>
#include <stdlib.h>

extern char **environ;

static void usage(void);

int main(int argc, char **argv) {
    if(argc != 1){ fprintf(stderr, "argc !=1"); usage(); exit(1); }

    for(int i = 0; environ[i] != NULL; i++) {
        puts(environ[i]);
    }
    return 0;
}

static void usage(void) {
#define USAGE "Usage:\n\
  Helloworld\n"
    printf(USAGE);
}
